import dao.*;

import java.math.BigDecimal;
import java.util.HashMap;

public class Main {
    public static void main(String[] args) {

////        42
//        buyAppleandStrawberry(2,2);

////        82
//        HashMap<Fruit, Integer> fruitBucket = new HashMap<>();
//        fruitBucket.put(new Apple(), 2);
//        fruitBucket.put(new Strawberry(), 2);
//        fruitBucket.put(new Mango(), 2);
//        System.out.println(buyFruits(fruitBucket));

////        76.8
//        HashMap<Fruit, Integer> fruitBucket = new HashMap<>();
//        fruitBucket.put(new Apple(), 2);
//        fruitBucket.put(new Mango(), 2);
//        fruitBucket.put(new Strawberry(new BigDecimal(80)), 2);
//        System.out.println(buyFruitsWithDiscount(fruitBucket));


//        76.8
//        90.8
        HashMap<Fruit, Integer> fruitBucket = new HashMap<>();
        fruitBucket.put(new Apple(), 2);
        fruitBucket.put(new Mango(), 2);
        fruitBucket.put(new Strawberry(new BigDecimal(80)), 2);
        Coupon coupon = new Coupon(new BigDecimal(100),new BigDecimal(10));
        System.out.println(buyFruitsWithDiscountAndCoupon(fruitBucket,coupon));

        fruitBucket = new HashMap<>();
        fruitBucket.put(new Apple(), 5);
        fruitBucket.put(new Mango(), 2);
        fruitBucket.put(new Strawberry(new BigDecimal(80)), 2);
        Coupon coupon2 = new Coupon(new BigDecimal(100),new BigDecimal(10));
        System.out.println(buyFruitsWithDiscountAndCoupon(fruitBucket,coupon2));

    }

    public static void buyAppleandStrawberry(Integer appleNum, Integer strawberryNum) {
        Customer customer = new Customer();
        System.out.println(customer.buyAppleandStrawberry(appleNum, strawberryNum));
    }

    public static BigDecimal buyFruits(HashMap<Fruit,Integer> fruits) {
        Customer customer = new Customer();
        return customer.buyFruits(fruits);
    }
    public static BigDecimal buyFruitsWithDiscount(HashMap<Fruit,Integer> fruits) {
        Customer customer = new Customer();
        return customer.buyFruitsWithDiscount(fruits);
    }

    public static BigDecimal buyFruitsWithDiscountAndCoupon(HashMap<Fruit,Integer> fruits,Coupon coupon) {
        Customer customer = new Customer();
        return customer.buyFruitsWithDiscountAndCoupon(fruits,coupon);
    }
}